@import '../common/style/index.less';

@cascader: ~'@{prefix}-cascader';

@cascader-active-color: var(--td-cascader-active-color, @brand-color);
@cascader-disabled-color: var(--td-cascader-disabled-color, @font-gray-4);
@cascader-title-color: var(--td-cascader-title-color, @font-gray-1);
@cascader-options-title-color: var(--td-cascader-options-title-color, @font-gray-3);
@cascader-border-color: var(--td-cascader-border-color, @border-color);

@cascader-options-height: var(--td-cascader-options-height, 640rpx);
@cascder-title-font-size: var(--td-cascder-title-font-size, 36rpx);

// steps
@cascader-step-height: var(--td-cascader-step-height, 88rpx);
@cascader-step-dot-size: var(--td-cascader-step-dot-size, 16rpx);
@cascader-step-arrow-color: var(--td-cascader-step-arrow-color, @font-gray-3);

.@{cascader} {
  display: flex;
  flex-direction: column;
  background-color: #fff;
  color: @cascader-title-color;
  border-radius: 24rpx 24rpx 0 0;
  --td-radio-icon-checked-color: @cascader-active-color;
  --td-tab-item-active-color: @cascader-active-color;
  --td-tab-track-color: @cascader-active-color;

  &__close-btn {
    right: 16px;
    top: 12px;
    position: absolute;
  }

  &__title {
    position: relative;
    font-weight: 700;
    text-align: center;
    line-height: 48px;
    font-size: @cascder-title-font-size;
  }

  &__content {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  &__options {
    width: 100vw;
    height: @cascader-options-height;

    &-title {
      margin-top: 40rpx;
      color: @cascader-options-title-color;
      font-size: 28rpx;
      line-height: 44rpx;
      padding-left: 16px;
    }

    &-content {
      flex: 1;
      height: 100%;
      overflow: auto;
      padding-left: 16px;
    }

    &-container {
      display: flex;
      transition: all ease 0.3s;
    }
  }

  &__step {
    display: flex;
    align-items: center;
    height: @cascader-step-height;

    &s {
      padding: 0 32rpx 10rpx;
      .border(bottom, @cascader-border-color);
    }

    &-dot {
      position: relative;
      width: @cascader-step-dot-size;
      height: @cascader-step-dot-size;
      border-radius: 50%;
      border: 1px solid @cascader-active-color;
      box-sizing: border-box;

      &:not(.@{cascader}__step-dot--last)::after {
        content: '';
        display: block;
        position: absolute;
        left: 50%;
        top: calc(@cascader-step-dot-size + 14rpx);
        height: 36rpx;
        width: 1px;
        background: @cascader-active-color;
        transform: translateX(-50%);
      }

      &--active {
        background: @cascader-active-color;
        border-color: @cascader-active-color;
      }
    }

    &-label {
      padding-left: 16px;
      font-size: 16px;

      &--active {
        color: @cascader-active-color;
        font-weight: 600;
      }
    }

    &-arrow {
      color: @cascader-step-arrow-color;
      margin-left: auto;
    }
  }
}
